/*
 * JMonthPanel.java
 *
 * Created on 21 de agosto de 2007, 19:44
 */

package es.atareao.alejandria.gui;

import es.atareao.alejandria.lib.Convert;
import java.util.Date;
import es.atareao.alejandria.lib.DateUtils;
import java.beans.PropertyChangeEvent;

/**
 *
 * @author  Propietario
 */
public class JLittleMonth extends javax.swing.JPanel {
    

    /** Creates new form JMonthPanel */
    public JLittleMonth() {
        initComponents();
        addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            @Override
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jDayPropertyChangeSelectedDay(evt);
            }
        });
        this.setMonth(DateUtils.Ahora());
    }
    private void jDayPropertyChangeSelectedDay(PropertyChangeEvent evt){
        if(evt.getPropertyName().equals("ChangeSelectedDay")){
            this.firePropertyChange("ModifiedSelectedDay",evt.getOldValue(),evt.getNewValue());
        }
    }
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabelSemanaNumber1 = new javax.swing.JLabel();
        jLittleDay11 = new es.atareao.alejandria.gui.JLittleDay();
        jLittleDay12 = new es.atareao.alejandria.gui.JLittleDay();
        jLittleDay13 = new es.atareao.alejandria.gui.JLittleDay();
        jLittleDay14 = new es.atareao.alejandria.gui.JLittleDay();
        jLittleDay15 = new es.atareao.alejandria.gui.JLittleDay();
        jLittleDay16 = new es.atareao.alejandria.gui.JLittleDay();
        jLittleDay17 = new es.atareao.alejandria.gui.JLittleDay();
        jLabelSemanaNumber2 = new javax.swing.JLabel();
        jLittleDay21 = new es.atareao.alejandria.gui.JLittleDay();
        jLittleDay22 = new es.atareao.alejandria.gui.JLittleDay();
        jLittleDay23 = new es.atareao.alejandria.gui.JLittleDay();
        jLittleDay24 = new es.atareao.alejandria.gui.JLittleDay();
        jLittleDay25 = new es.atareao.alejandria.gui.JLittleDay();
        jLittleDay26 = new es.atareao.alejandria.gui.JLittleDay();
        jLittleDay27 = new es.atareao.alejandria.gui.JLittleDay();
        jLabelSemanaNumber3 = new javax.swing.JLabel();
        jLittleDay31 = new es.atareao.alejandria.gui.JLittleDay();
        jLittleDay32 = new es.atareao.alejandria.gui.JLittleDay();
        jLittleDay33 = new es.atareao.alejandria.gui.JLittleDay();
        jLittleDay34 = new es.atareao.alejandria.gui.JLittleDay();
        jLittleDay35 = new es.atareao.alejandria.gui.JLittleDay();
        jLittleDay36 = new es.atareao.alejandria.gui.JLittleDay();
        jLittleDay37 = new es.atareao.alejandria.gui.JLittleDay();
        jLabelSemanaNumber4 = new javax.swing.JLabel();
        jLittleDay41 = new es.atareao.alejandria.gui.JLittleDay();
        jLittleDay42 = new es.atareao.alejandria.gui.JLittleDay();
        jLittleDay43 = new es.atareao.alejandria.gui.JLittleDay();
        jLittleDay44 = new es.atareao.alejandria.gui.JLittleDay();
        jLittleDay45 = new es.atareao.alejandria.gui.JLittleDay();
        jLittleDay46 = new es.atareao.alejandria.gui.JLittleDay();
        jLittleDay47 = new es.atareao.alejandria.gui.JLittleDay();
        jLabelSemanaNumber5 = new javax.swing.JLabel();
        jLittleDay51 = new es.atareao.alejandria.gui.JLittleDay();
        jLittleDay52 = new es.atareao.alejandria.gui.JLittleDay();
        jLittleDay53 = new es.atareao.alejandria.gui.JLittleDay();
        jLittleDay54 = new es.atareao.alejandria.gui.JLittleDay();
        jLittleDay55 = new es.atareao.alejandria.gui.JLittleDay();
        jLittleDay56 = new es.atareao.alejandria.gui.JLittleDay();
        jLittleDay57 = new es.atareao.alejandria.gui.JLittleDay();
        jLabelSemanaNumber6 = new javax.swing.JLabel();
        jLittleDay61 = new es.atareao.alejandria.gui.JLittleDay();
        jLittleDay62 = new es.atareao.alejandria.gui.JLittleDay();
        jLittleDay63 = new es.atareao.alejandria.gui.JLittleDay();
        jLittleDay64 = new es.atareao.alejandria.gui.JLittleDay();
        jLittleDay65 = new es.atareao.alejandria.gui.JLittleDay();
        jLittleDay66 = new es.atareao.alejandria.gui.JLittleDay();
        jLittleDay67 = new es.atareao.alejandria.gui.JLittleDay();

        setLayout(new java.awt.GridLayout(7, 8));

        jLabel1.setBackground(new java.awt.Color(231, 238, 236));
        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 10));
        jLabel1.setForeground(new java.awt.Color(63, 125, 145));
        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel1.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(63, 125, 145), 1, true));
        jLabel1.setOpaque(true);
        add(jLabel1);

        jLabel2.setBackground(new java.awt.Color(231, 238, 236));
        jLabel2.setFont(new java.awt.Font("Tahoma", 1, 10));
        jLabel2.setForeground(new java.awt.Color(63, 125, 145));
        jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel2.setText("L");
        jLabel2.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(63, 125, 145), 1, true));
        jLabel2.setOpaque(true);
        add(jLabel2);

        jLabel3.setBackground(new java.awt.Color(231, 238, 236));
        jLabel3.setFont(new java.awt.Font("Tahoma", 1, 10));
        jLabel3.setForeground(new java.awt.Color(63, 125, 145));
        jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel3.setText("M");
        jLabel3.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(63, 125, 145), 1, true));
        jLabel3.setOpaque(true);
        add(jLabel3);

        jLabel4.setBackground(new java.awt.Color(231, 238, 236));
        jLabel4.setFont(new java.awt.Font("Tahoma", 1, 10));
        jLabel4.setForeground(new java.awt.Color(63, 125, 145));
        jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel4.setText("X");
        jLabel4.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(63, 125, 145), 1, true));
        jLabel4.setOpaque(true);
        add(jLabel4);

        jLabel5.setBackground(new java.awt.Color(231, 238, 236));
        jLabel5.setFont(new java.awt.Font("Tahoma", 1, 10));
        jLabel5.setForeground(new java.awt.Color(63, 125, 145));
        jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel5.setText("J");
        jLabel5.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(63, 125, 145), 1, true));
        jLabel5.setOpaque(true);
        add(jLabel5);

        jLabel6.setBackground(new java.awt.Color(231, 238, 236));
        jLabel6.setFont(new java.awt.Font("Tahoma", 1, 10));
        jLabel6.setForeground(new java.awt.Color(63, 125, 145));
        jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel6.setText("V");
        jLabel6.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(63, 125, 145), 1, true));
        jLabel6.setOpaque(true);
        add(jLabel6);

        jLabel7.setBackground(new java.awt.Color(255, 249, 231));
        jLabel7.setFont(new java.awt.Font("Tahoma", 1, 10));
        jLabel7.setForeground(new java.awt.Color(63, 125, 145));
        jLabel7.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel7.setText("S");
        jLabel7.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(63, 125, 145), 1, true));
        jLabel7.setOpaque(true);
        add(jLabel7);

        jLabel8.setBackground(new java.awt.Color(255, 249, 231));
        jLabel8.setFont(new java.awt.Font("Tahoma", 1, 10));
        jLabel8.setForeground(new java.awt.Color(63, 125, 145));
        jLabel8.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel8.setText("D");
        jLabel8.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(63, 125, 145), 1, true));
        jLabel8.setOpaque(true);
        add(jLabel8);

        jLabelSemanaNumber1.setBackground(new java.awt.Color(231, 238, 236));
        jLabelSemanaNumber1.setFont(new java.awt.Font("Tahoma", 1, 10));
        jLabelSemanaNumber1.setForeground(new java.awt.Color(63, 125, 145));
        jLabelSemanaNumber1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelSemanaNumber1.setText(" 1");
        jLabelSemanaNumber1.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(63, 125, 145), 1, true));
        jLabelSemanaNumber1.setOpaque(true);
        add(jLabelSemanaNumber1);

        jLittleDay11.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jDayPropertyChange(evt);
            }
        });
        add(jLittleDay11);

        jLittleDay12.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jDayPropertyChange(evt);
            }
        });
        add(jLittleDay12);

        jLittleDay13.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jDayPropertyChange(evt);
            }
        });
        add(jLittleDay13);

        jLittleDay14.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jDayPropertyChange(evt);
            }
        });
        add(jLittleDay14);

        jLittleDay15.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jDayPropertyChange(evt);
            }
        });
        add(jLittleDay15);

        jLittleDay16.setHoliday(true);
        jLittleDay16.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jDayPropertyChange(evt);
            }
        });
        add(jLittleDay16);

        jLittleDay17.setHoliday(true);
        jLittleDay17.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jDayPropertyChange(evt);
            }
        });
        add(jLittleDay17);

        jLabelSemanaNumber2.setBackground(new java.awt.Color(231, 238, 236));
        jLabelSemanaNumber2.setFont(new java.awt.Font("Tahoma", 1, 10));
        jLabelSemanaNumber2.setForeground(new java.awt.Color(63, 125, 145));
        jLabelSemanaNumber2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelSemanaNumber2.setText(" 1");
        jLabelSemanaNumber2.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(63, 125, 145), 1, true));
        jLabelSemanaNumber2.setOpaque(true);
        add(jLabelSemanaNumber2);

        jLittleDay21.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jDayPropertyChange(evt);
            }
        });
        add(jLittleDay21);

        jLittleDay22.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jDayPropertyChange(evt);
            }
        });
        add(jLittleDay22);

        jLittleDay23.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jDayPropertyChange(evt);
            }
        });
        add(jLittleDay23);

        jLittleDay24.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jDayPropertyChange(evt);
            }
        });
        add(jLittleDay24);

        jLittleDay25.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jDayPropertyChange(evt);
            }
        });
        add(jLittleDay25);

        jLittleDay26.setHoliday(true);
        jLittleDay26.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jDayPropertyChange(evt);
            }
        });
        add(jLittleDay26);

        jLittleDay27.setHoliday(true);
        jLittleDay27.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jDayPropertyChange(evt);
            }
        });
        add(jLittleDay27);

        jLabelSemanaNumber3.setBackground(new java.awt.Color(231, 238, 236));
        jLabelSemanaNumber3.setFont(new java.awt.Font("Tahoma", 1, 10));
        jLabelSemanaNumber3.setForeground(new java.awt.Color(63, 125, 145));
        jLabelSemanaNumber3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelSemanaNumber3.setText(" 1");
        jLabelSemanaNumber3.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(63, 125, 145), 1, true));
        jLabelSemanaNumber3.setOpaque(true);
        add(jLabelSemanaNumber3);

        jLittleDay31.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jDayPropertyChange(evt);
            }
        });
        add(jLittleDay31);

        jLittleDay32.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jDayPropertyChange(evt);
            }
        });
        add(jLittleDay32);

        jLittleDay33.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jDayPropertyChange(evt);
            }
        });
        add(jLittleDay33);

        jLittleDay34.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jDayPropertyChange(evt);
            }
        });
        add(jLittleDay34);

        jLittleDay35.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jDayPropertyChange(evt);
            }
        });
        add(jLittleDay35);

        jLittleDay36.setHoliday(true);
        jLittleDay36.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jDayPropertyChange(evt);
            }
        });
        add(jLittleDay36);

        jLittleDay37.setHoliday(true);
        jLittleDay37.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jDayPropertyChange(evt);
            }
        });
        add(jLittleDay37);

        jLabelSemanaNumber4.setBackground(new java.awt.Color(231, 238, 236));
        jLabelSemanaNumber4.setFont(new java.awt.Font("Tahoma", 1, 10));
        jLabelSemanaNumber4.setForeground(new java.awt.Color(63, 125, 145));
        jLabelSemanaNumber4.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelSemanaNumber4.setText(" 1");
        jLabelSemanaNumber4.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(63, 125, 145), 1, true));
        jLabelSemanaNumber4.setOpaque(true);
        add(jLabelSemanaNumber4);

        jLittleDay41.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jDayPropertyChange(evt);
            }
        });
        add(jLittleDay41);

        jLittleDay42.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jDayPropertyChange(evt);
            }
        });
        add(jLittleDay42);

        jLittleDay43.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jDayPropertyChange(evt);
            }
        });
        add(jLittleDay43);

        jLittleDay44.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jDayPropertyChange(evt);
            }
        });
        add(jLittleDay44);

        jLittleDay45.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jDayPropertyChange(evt);
            }
        });
        add(jLittleDay45);

        jLittleDay46.setHoliday(true);
        jLittleDay46.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jDayPropertyChange(evt);
            }
        });
        add(jLittleDay46);

        jLittleDay47.setHoliday(true);
        jLittleDay47.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jDayPropertyChange(evt);
            }
        });
        add(jLittleDay47);

        jLabelSemanaNumber5.setBackground(new java.awt.Color(231, 238, 236));
        jLabelSemanaNumber5.setFont(new java.awt.Font("Tahoma", 1, 10));
        jLabelSemanaNumber5.setForeground(new java.awt.Color(63, 125, 145));
        jLabelSemanaNumber5.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelSemanaNumber5.setText(" 1");
        jLabelSemanaNumber5.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(63, 125, 145), 1, true));
        jLabelSemanaNumber5.setOpaque(true);
        add(jLabelSemanaNumber5);

        jLittleDay51.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jDayPropertyChange(evt);
            }
        });
        add(jLittleDay51);

        jLittleDay52.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jDayPropertyChange(evt);
            }
        });
        add(jLittleDay52);

        jLittleDay53.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jDayPropertyChange(evt);
            }
        });
        add(jLittleDay53);

        jLittleDay54.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jDayPropertyChange(evt);
            }
        });
        add(jLittleDay54);

        jLittleDay55.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jDayPropertyChange(evt);
            }
        });
        add(jLittleDay55);

        jLittleDay56.setHoliday(true);
        jLittleDay56.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jDayPropertyChange(evt);
            }
        });
        add(jLittleDay56);

        jLittleDay57.setHoliday(true);
        jLittleDay57.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jDayPropertyChange(evt);
            }
        });
        add(jLittleDay57);

        jLabelSemanaNumber6.setBackground(new java.awt.Color(231, 238, 236));
        jLabelSemanaNumber6.setFont(new java.awt.Font("Tahoma", 1, 10));
        jLabelSemanaNumber6.setForeground(new java.awt.Color(63, 125, 145));
        jLabelSemanaNumber6.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelSemanaNumber6.setText(" 1");
        jLabelSemanaNumber6.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(63, 125, 145), 1, true));
        jLabelSemanaNumber6.setOpaque(true);
        add(jLabelSemanaNumber6);

        jLittleDay61.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jDayPropertyChange(evt);
            }
        });
        add(jLittleDay61);

        jLittleDay62.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jDayPropertyChange(evt);
            }
        });
        add(jLittleDay62);

        jLittleDay63.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jDayPropertyChange(evt);
            }
        });
        add(jLittleDay63);

        jLittleDay64.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jDayPropertyChange(evt);
            }
        });
        add(jLittleDay64);

        jLittleDay65.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jDayPropertyChange(evt);
            }
        });
        add(jLittleDay65);

        jLittleDay66.setHoliday(true);
        jLittleDay66.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jDayPropertyChange(evt);
            }
        });
        add(jLittleDay66);

        jLittleDay67.setHoliday(true);
        jLittleDay67.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jDayPropertyChange(evt);
            }
        });
        add(jLittleDay67);
    }// </editor-fold>//GEN-END:initComponents

    private void jDayPropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_jDayPropertyChange
        if(evt.getPropertyName().equals("SelectedDay")){
            if(evt.getSource() instanceof JLittleDay){
                int newPosition=((Integer)evt.getNewValue()).intValue();
                if((_position>0)&&(_position<43)&&(_position!=newPosition)){
                    this.getDay(_position).setSelected(false);
                }
                _position=newPosition;
                //
                Date primero=DateUtils.firstMondayOfTable(_month);
                Date oldSelected=this._selectedDay;
                this._selectedDay=DateUtils.addDays(primero,_position-1);
                this.firePropertyChange("ChangeSelectedDay",oldSelected,_selectedDay);
            }
        }
    }//GEN-LAST:event_jDayPropertyChange
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabelSemanaNumber1;
    private javax.swing.JLabel jLabelSemanaNumber2;
    private javax.swing.JLabel jLabelSemanaNumber3;
    private javax.swing.JLabel jLabelSemanaNumber4;
    private javax.swing.JLabel jLabelSemanaNumber5;
    private javax.swing.JLabel jLabelSemanaNumber6;
    private es.atareao.alejandria.gui.JLittleDay jLittleDay11;
    private es.atareao.alejandria.gui.JLittleDay jLittleDay12;
    private es.atareao.alejandria.gui.JLittleDay jLittleDay13;
    private es.atareao.alejandria.gui.JLittleDay jLittleDay14;
    private es.atareao.alejandria.gui.JLittleDay jLittleDay15;
    private es.atareao.alejandria.gui.JLittleDay jLittleDay16;
    private es.atareao.alejandria.gui.JLittleDay jLittleDay17;
    private es.atareao.alejandria.gui.JLittleDay jLittleDay21;
    private es.atareao.alejandria.gui.JLittleDay jLittleDay22;
    private es.atareao.alejandria.gui.JLittleDay jLittleDay23;
    private es.atareao.alejandria.gui.JLittleDay jLittleDay24;
    private es.atareao.alejandria.gui.JLittleDay jLittleDay25;
    private es.atareao.alejandria.gui.JLittleDay jLittleDay26;
    private es.atareao.alejandria.gui.JLittleDay jLittleDay27;
    private es.atareao.alejandria.gui.JLittleDay jLittleDay31;
    private es.atareao.alejandria.gui.JLittleDay jLittleDay32;
    private es.atareao.alejandria.gui.JLittleDay jLittleDay33;
    private es.atareao.alejandria.gui.JLittleDay jLittleDay34;
    private es.atareao.alejandria.gui.JLittleDay jLittleDay35;
    private es.atareao.alejandria.gui.JLittleDay jLittleDay36;
    private es.atareao.alejandria.gui.JLittleDay jLittleDay37;
    private es.atareao.alejandria.gui.JLittleDay jLittleDay41;
    private es.atareao.alejandria.gui.JLittleDay jLittleDay42;
    private es.atareao.alejandria.gui.JLittleDay jLittleDay43;
    private es.atareao.alejandria.gui.JLittleDay jLittleDay44;
    private es.atareao.alejandria.gui.JLittleDay jLittleDay45;
    private es.atareao.alejandria.gui.JLittleDay jLittleDay46;
    private es.atareao.alejandria.gui.JLittleDay jLittleDay47;
    private es.atareao.alejandria.gui.JLittleDay jLittleDay51;
    private es.atareao.alejandria.gui.JLittleDay jLittleDay52;
    private es.atareao.alejandria.gui.JLittleDay jLittleDay53;
    private es.atareao.alejandria.gui.JLittleDay jLittleDay54;
    private es.atareao.alejandria.gui.JLittleDay jLittleDay55;
    private es.atareao.alejandria.gui.JLittleDay jLittleDay56;
    private es.atareao.alejandria.gui.JLittleDay jLittleDay57;
    private es.atareao.alejandria.gui.JLittleDay jLittleDay61;
    private es.atareao.alejandria.gui.JLittleDay jLittleDay62;
    private es.atareao.alejandria.gui.JLittleDay jLittleDay63;
    private es.atareao.alejandria.gui.JLittleDay jLittleDay64;
    private es.atareao.alejandria.gui.JLittleDay jLittleDay65;
    private es.atareao.alejandria.gui.JLittleDay jLittleDay66;
    private es.atareao.alejandria.gui.JLittleDay jLittleDay67;
    // End of variables declaration//GEN-END:variables
    private Date _selectedDay;
    private Date _month;
    private int _position=0;

    /**
     * @return the _date
     */
    public Date getSelectedDay() {
        return _selectedDay;
    }

    /**
     * @param date the _date to set
     */
    public void setMonth(Date date) {
        this._month = date;
        if(this._selectedDay==null){
            this._selectedDay=date;
        }
        inicializa(date);
    }
    public void setSelectedDay(Date date) {
        this._selectedDay = date;
        if(this._month==null){
            this.setMonth(date);
        }
    }
    private void inicializa(Date date){
        Date primero=DateUtils.firstMondayOfTable(date);
        int inicio=DateUtils.dayOfYear(primero);
        int hoy=DateUtils.dayOfYear(DateUtils.Ahora());
        int mes_actual=DateUtils.monthOfYear(date);
        for(int dia=1;dia<43;dia++){
            Date este_dia=DateUtils.addDays(primero, dia-1);
            int este_mes=DateUtils.monthOfYear(este_dia);
            this.getDay(dia).setDay(DateUtils.dayOfMonth(este_dia));
            if(este_mes!=mes_actual){
                this.getDay(dia).setThisMonth(false);
            }else{
                this.getDay(dia).setThisMonth(true);
            }
            this.getDay(dia).setToday(false);

            if(DateUtils.areEqualsDates(este_dia,_selectedDay)){
                this.getDay(dia).setSelected(true);
                _position=dia;
            }else{
                this.getDay(dia).setSelected(false);
            }
            this.getDay(dia).setPosition(dia);
        }
        this.jLabelSemanaNumber1.setText(Convert.toString(DateUtils.weekOfYear(DateUtils.addDays(primero,0))));
        this.jLabelSemanaNumber2.setText(Convert.toString(DateUtils.weekOfYear(DateUtils.addDays(primero,7))));
        this.jLabelSemanaNumber3.setText(Convert.toString(DateUtils.weekOfYear(DateUtils.addDays(primero,14))));
        this.jLabelSemanaNumber4.setText(Convert.toString(DateUtils.weekOfYear(DateUtils.addDays(primero,21))));
        this.jLabelSemanaNumber5.setText(Convert.toString(DateUtils.weekOfYear(DateUtils.addDays(primero,28))));
        this.jLabelSemanaNumber6.setText(Convert.toString(DateUtils.weekOfYear(DateUtils.addDays(primero,35))));
        if(DateUtils.monthOfYear(date)==DateUtils.monthOfYear(DateUtils.Ahora())){
            if(DateUtils.year(date)==DateUtils.year(DateUtils.Ahora())){
                this.getDay(hoy-inicio+1).setToday(true);
            }
        }
        /*
        if((_position>0)&&(_position<43)){
            this.getDay(_position).setSelected(false);
        }
        _position=selected-inicio+1;
        if((_position>0)&&(_position<43)){
            this.getDay(_position).setSelected(true);
        }
         * 
         */
    }
    private JLittleDay getDay(int day){
        switch(day){
            case 1:
                return this.jLittleDay11;
            case 2:
                return this.jLittleDay12;
            case 3:
                return this.jLittleDay13;
            case 4:
                return this.jLittleDay14;
            case 5:
                return this.jLittleDay15;
            case 6:
                return this.jLittleDay16;
            case 7:
                return this.jLittleDay17;
            case 8:
                return this.jLittleDay21;
            case 9:
                return this.jLittleDay22;
            case 10:
                return this.jLittleDay23;
            case 11:
                return this.jLittleDay24;
            case 12:
                return this.jLittleDay25;
            case 13:
                return this.jLittleDay26;
            case 14:
                return this.jLittleDay27;
            case 15:
                return this.jLittleDay31;
            case 16:
                return this.jLittleDay32;
            case 17:
                return this.jLittleDay33;
            case 18:
                return this.jLittleDay34;
            case 19:
                return this.jLittleDay35;
            case 20:
                return this.jLittleDay36;
            case 21:
                return this.jLittleDay37;
            case 22:
                return this.jLittleDay41;
            case 23:
                return this.jLittleDay42;
            case 24:
                return this.jLittleDay43;
            case 25:
                return this.jLittleDay44;
            case 26:
                return this.jLittleDay45;
            case 27:
                return this.jLittleDay46;
            case 28:
                return this.jLittleDay47;
            case 29:
                return this.jLittleDay51;
            case 30:
                return this.jLittleDay52;
            case 31:
                return this.jLittleDay53;
            case 32:
                return this.jLittleDay54;
            case 33:
                return this.jLittleDay55;
            case 34:
                return this.jLittleDay56;
            case 35:
                return this.jLittleDay57;
            case 36:
                return this.jLittleDay61;
            case 37:
                return this.jLittleDay62;
            case 38:
                return this.jLittleDay63;
            case 39:
                return this.jLittleDay64;
            case 40:
                return this.jLittleDay65;
            case 41:
                return this.jLittleDay66;
            case 42:
                return this.jLittleDay67;
        }
        return null;
    }
}